package com.mathmodeling.entity;

import javax.persistence.*;
import java.time.LocalDateTime;

@Entity
@Table(name = "team")
public class Team {
    
    @Id
    @Column(name = "id", length = 36)
    private String id;
    
    @Column(name = "name", length = 100, nullable = false)
    private String name;
    
    @Column(name = "captain_id", length = 36, nullable = false)
    private String captainId;
    
    @Column(name = "created_at")
    private LocalDateTime createdAt;
    
    // 构造函数
    public Team() {}
    
    public Team(String id, String name, String captainId) {
        this.id = id;
        this.name = name;
        this.captainId = captainId;
        this.createdAt = LocalDateTime.now();
    }
    
    // Getter和Setter方法
    public String getId() {
        return id;
    }
    
    public void setId(String id) {
        this.id = id;
    }
    
    public String getName() {
        return name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    public String getCaptainId() {
        return captainId;
    }
    
    public void setCaptainId(String captainId) {
        this.captainId = captainId;
    }
    
    public LocalDateTime getCreatedAt() {
        return createdAt;
    }
    
    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }
} 